package net.cmbt.okframe.okwebview;

/**
 * Created by LG on 2019/11/26.
 */

public class SuperWebView {

    private boolean UseGoBack; //开启返回按键处理
    private boolean supportJS; // 支持JS
    private boolean supportAccessFiles;  //支持文件访问
    private boolean supportCallSMS; //支持打电话 发短信
    private boolean builtInZoomControls; //缩放按钮
    private UpDownFileManager upDownFileManager;
    private WebCacheManager webCacheManager;
    private String Url; //地址1
    private String HtmlData; //地址2
    private boolean supportImgLongClick; //长按图片

    public SuperWebView(Builder builder) {
        this.UseGoBack = builder.UseGoBack;
        this.supportJS = builder.supportJS;
        this.supportAccessFiles = builder.supportAccessFiles;
        this.supportCallSMS = builder.supportCallSMS;
        this.builtInZoomControls = builder.builtInZoomControls;
        this.upDownFileManager = builder.upDownFileManager;
        this.webCacheManager = builder.webCacheManager;
        this.Url = builder.Url;
        this.HtmlData = builder.HtmlData;
        this.supportImgLongClick = builder.supportImgLongClick;
    }

    public boolean isSupportImgLongClick() {
        return supportImgLongClick;
    }

    public void setSupportImgLongClick(boolean supportImgLongClick) {
        this.supportImgLongClick = supportImgLongClick;
    }

    public String getUrl() {
        return Url;
    }

    public void setUrl(String url) {
        Url = url;
    }

    public String getHtmlData() {
        return HtmlData;
    }

    public void setHtmlData(String htmlData) {
        HtmlData = htmlData;
    }

    public boolean isUseGoBack() {
        return UseGoBack;
    }

    public void setUseGoBack(boolean useGoBack) {
        UseGoBack = useGoBack;
    }

    public boolean isSupportJS() {
        return supportJS;
    }

    public void setSupportJS(boolean supportJS) {
        this.supportJS = supportJS;
    }

    public boolean isSupportAccessFiles() {
        return supportAccessFiles;
    }

    public void setSupportAccessFiles(boolean supportAccessFiles) {
        this.supportAccessFiles = supportAccessFiles;
    }

    public boolean isSupportCallSMS() {
        return supportCallSMS;
    }

    public void setSupportCallSMS(boolean supportCallSMS) {
        this.supportCallSMS = supportCallSMS;
    }

    public boolean isBuiltInZoomControls() {
        return builtInZoomControls;
    }

    public void setBuiltInZoomControls(boolean builtInZoomControls) {
        this.builtInZoomControls = builtInZoomControls;
    }

    public UpDownFileManager getUpDownFileManager() {
        return upDownFileManager;
    }

    public void setUpDownFileManager(UpDownFileManager upDownFileManager) {
        this.upDownFileManager = upDownFileManager;
    }

    public WebCacheManager getWebCacheManager() {
        return webCacheManager;
    }

    public void setWebCacheManager(WebCacheManager webCacheManager) {
        this.webCacheManager = webCacheManager;
    }


    public static class Builder {
        private boolean UseGoBack; //开启返回按键处理
        private boolean supportJS; // 支持JS
        private boolean supportAccessFiles;  //支持文件访问
        private boolean supportCallSMS; //支持打电话 发短信
        private boolean supportImgLongClick; //支持图片长按操作
        private boolean builtInZoomControls; //缩放按钮
        private String Url; //地址1
        private String HtmlData; //地址2
        private UpDownFileManager upDownFileManager;
        private WebCacheManager webCacheManager;


        public Builder setSupportImgLongClick(boolean supportImgLongClick) {
            this.supportImgLongClick = supportImgLongClick;
            return this;
        }

        public Builder setUrl(String url) {
            Url = url;
            return this;
        }

        public Builder setHtmlData(String htmlData) {
            HtmlData = htmlData;
            return this;
        }

        public Builder setUseGoBack(boolean useGoBack) {
            this.UseGoBack = useGoBack;
            return this;
        }

        public Builder setSupportJS(boolean supportJS) {
            this.supportJS = supportJS;
            return this;
        }


        public Builder setSupportAccessFiles(boolean supportAccessFiles) {
            this.supportAccessFiles = supportAccessFiles;
            return this;
        }


        public Builder setSupportCallSMS(boolean supportCallSMS) {
            this.supportCallSMS = supportCallSMS;
            return this;
        }


        public Builder setBuiltInZoomControls(boolean builtInZoomControls) {
            this.builtInZoomControls = builtInZoomControls;
            return this;
        }

        public Builder setUpDownFileManager(UpDownFileManager upDownFileManager) {
            this.upDownFileManager = upDownFileManager;
            return this;
        }

        public Builder setWebCacheManager(WebCacheManager webCacheManager) {
            this.webCacheManager = webCacheManager;
            return this;
        }

        public SuperWebView build() {
            return new SuperWebView(this);
        }

    }


}
